import 'package:flutter/material.dart';
import 'package:flutter_order_food/constants.dart';
import 'package:flutter_svg/flutter_svg.dart';

AppBar homeAppBar(BuildContext context) {
  return AppBar(
    backgroundColor: Colors.white,
    elevation: 0,
    leading: IconButton(
      icon: SvgPicture.asset("assets/icons/menu.svg"),
      onPressed: () {},
    ),
    centerTitle: true, //这里博主没有加上，所以导致标题没有居中
    title: RichText(
      text: TextSpan(
          style: Theme.of(context)
              .textTheme
              .headline6
              .copyWith(fontWeight: FontWeight.bold),
          children: [
            TextSpan(
              text: "Punk",
              style: TextStyle(
                color: ksecondaryColor,
              ),
            ),
            TextSpan(
              text: "Food",
              style: TextStyle(
                color: kPrimaryColor,
              ),
            ),
          ]),
    ),
    actions: [
      IconButton(
        icon: SvgPicture.asset("assets/icons/notification.svg"),
        onPressed: () {},
      )
    ],
  );
}
